<ui:composition template="/WEB-INF/templates/public-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<h:outputText value="Employee Leave Cancellation Request" styleClass="outputTextTitle" />
			<h:panelGrid columns="1" >
			
				
				<h:panelGrid columns="6" style="border: 1px solid #d9d9d9;width: 100%" cellspacing="10">
				  <h:outputLabel value="#{msg['employeeidoremployeename.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{approveCancelledLeaveBean.employeeLeave.employee.firstName}/#{approveCancelledLeaveBean.employeeLeave.employee.employeeCode}." readonly="true"/>  
	                </p:inplace>
					<h:outputLabel value="#{msg['modulename.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{approveCancelledLeaveBean.employeeLeave.employee.moduleName}" readonly="true"/>  
	                </p:inplace>
	                
	                <h:outputLabel value="#{msg['projectname.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveCancelledLeaveBean.employeeAndReporting.project}" readonly="true"/>  
	                </p:inplace>
					<h:outputLabel value="#{msg['leavetype.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{approveCancelledLeaveBean.employeeLeave.leaveType.leaveType}" readonly="true"/>  
	                </p:inplace>
	               
					
					
					<h:outputLabel value="#{msg['leaveappliedon.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveCancelledLeaveBean.employeeLeave.appliedOn}" readonly="true">
	                        <f:convertDateTime pattern="dd-MMM-yyyy"/>
	                       </p:inputText>  
	                </p:inplace>
	               
	                
	                
	                <h:outputLabel value="#{msg['timetnterval.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                        <p:inputText value="#{approveCancelledLeaveBean.leaveFromToBeDisplayed} to #{approveCancelledLeaveBean.leaveToToBeDisplayed}" readonly="true"/>
	                       
	                </p:inplace>
	                 <h:outputLabel  value="#{msg['nodays.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveCancelledLeaveBean.employeeLeave.noOfDays}" readonly="true"/> 
	                       
	                </p:inplace>
	              
	                
	                 <h:outputLabel  value="#{msg['tomail.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveCancelledLeaveBean.employeeLeave.employee.email}" readonly="true"/> 
	                       
	                </p:inplace>
	             
	                <h:outputLabel  value="#{msg['contactnumber.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveCancelledLeaveBean.employeeLeave.employee.telephone}" readonly="true"/> 
	                       
	                </p:inplace>
	               
	                 <h:outputLabel  value="#{msg['reasonforleavecancellation.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputTextarea value="#{approveCancelledLeaveBean.employeeLeave.reasonForCancel}" readonly="true"/> 
	                </p:inplace>
	               
	              
				    <h:panelGroup>
	                 <h:outputLabel value="*" style="color:red;" />	
					<h:outputLabel value="Cancellation Comments" style="font-size: 12px;" />
				   </h:panelGroup>	
					<h:outputLabel value=" : " />				
					
	                <p:inputTextarea value="#{approveCancelledLeaveBean.employeeLeave.cancellationComments}" rendered="#{approveCancelledLeaveBean.leaveCancelRequestApprovedAlready}"/>
	                <p:inputTextarea value="#{approveCancelledLeaveBean.employeeLeave.cancellationComments}" readonly="true" rendered="#{not approveCancelledLeaveBean.leaveCancelRequestApprovedAlready}"/> 
	                
					
	                
	                <h:inputHidden /><h:inputHidden />
					<h:inputHidden /><h:inputHidden />
					<h:inputHidden /><h:inputHidden />
					<h:inputHidden /><h:inputHidden />
					<h:inputHidden />
					<h:inputHidden />
					<h:inputHidden />    
					<h:panelGrid columns="2" rendered="#{approveCancelledLeaveBean.leaveCancelRequestApprovedAlready}">
					 <p:commandButton  value="Approve" id="Accept" actionListener="#{approveCancelledLeaveBean.leveCancelRequestApprovedORRejectAction}" update="growl"/>
					 <p:commandButton  value="Reject" id="Reject" actionListener="#{approveCancelledLeaveBean.leveCancelRequestApprovedORRejectAction}" update="growl"/>
					
				    </h:panelGrid>
				    
				    
				</h:panelGrid>
				
			    <h:outputLabel styleClass="outputTextTitle" style="font-size:16px;" value="Leave cancelled already" rendered="#{approveCancelledLeaveBean.employeeLeave.approvalStatus eq 'CANCELLED'}"/>	 
				
				<h:outputLabel styleClass="outputTextTitle" style="font-size:16px;" value="Leave cancelltion request has been rejected already" rendered="#{approveCancelledLeaveBean.employeeLeave.approvalStatus eq 'REJECTED'}"/>
				
				<h:outputLabel styleClass="outputTextTitle" style="font-size:12px;" value="Note:Approving leave will automatically send an email to mail id specified above with comments." rendered="#{approveCancelledLeaveBean.employeeLeave.approvalStatus eq 'CANCELLATION IN PROCESS'}"/>
                                 	
			</h:panelGrid>
			<p:growl id="growl"></p:growl>
		</h:form>
	</ui:define>
</ui:composition>

